package com.le.basic.recur;

public class Code_01_hanoi {

    public static void process(int n, String from, String to, String help) {
        if (n == 1) {
            System.out.println("move 1" + "from " + from + "to " + to);
            return;
        }
        process(n - 1, from, help, to);
        System.out.println("move " + n + "from " + from + "to " + help);
        process(n - 1, help, to, from);
    }

    public static void main(String[] args) {
        process(3, "left", "right", "mid");
    }
}
